Skip to content

refactor: remove duplication of functions in imp felt #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

AvivYossef-starkware
Copy link
Collaborator

@AvivYossef-starkware AvivYossef-starkware commented May 9, 2024

This change is Reviewable

@codecov-commenter
Copy link

codecov-commenter commented May 9, 2024

Codecov Report

Attention: Patch coverage is 14.28571% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 76.39%. Comparing base (99d0118) to head (90ed4e1).

Files Patch % Lines
...src/patricia_merkle_tree/filled_tree/node_serde.rs 0.00% 5 Missing ⚠️
...r/src/patricia_merkle_tree/node_data/leaf_serde.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #106      +/-   ##
==========================================
- Coverage   76.47%   76.39%   -0.09%     
==========================================
  Files          25       25              
  Lines         884      881       -3     
  Branches      884      881       -3     
==========================================
- Hits          676      673       -3     
  Misses        174      174              
  Partials       34       34              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @amosStarkware and @AvivYossef-starkware)


crates/committer/src/felt.rs line 82 at r1 (raw file):

    pub fn as_bytes(&self) -> [u8; 32] {
        self.0.to_bytes_be()
    }

I prefer the passthrough functions keep their name

Suggestion:

    /// Parse a hex-encoded number into `Felt`.
    pub(crate) fn from_hex(hex_string: &str) -> Result<Self, FromStrError> {
        Ok(StarknetTypesFelt::from_hex(hex_string)?.into())
    }

    pub fn to_bytes_be(&self) -> [u8; 32] {
        self.0.to_bytes_be()
    }

@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/remove_duplication_function_from_felt branch from b1ffded to 90ed4e1 Compare May 9, 2024 10:58
Copy link
Collaborator Author

@AvivYossef-starkware AvivYossef-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 7 files reviewed, 1 unresolved discussion (waiting on @amosStarkware and @dorimedini-starkware)


crates/committer/src/felt.rs line 82 at r1 (raw file):

Previously, dorimedini-starkware wrote…

I prefer the passthrough functions keep their name

Ok.

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 7 of 7 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @amosStarkware)

@AvivYossef-starkware AvivYossef-starkware added this pull request to the merge queue May 9, 2024
Merged via the queue into main with commit 7525672 May 9, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants